/*public class MyArrayList1{
    public static void main(String[] args) {
        Cat cat = new Cat(10 , "小红");
        Animal animal = new Cat(10 , "小黑");//相当于是小转大，是合理的，范围小的转范围大的
        cat.eat();

    }

}
class Animal{
    public int age;
    public String name;

    public Animal(int age, String name) {
        this.age = age;
        this.name = name;
    }

    public void eat(){
        System.out.println(name + "吃东西");
    }
}
class Cat extends Animal{
    @Override
    public void eat() {
        System.out.println(name + "吃猫粮");
    }

    public Cat(int age, String name) {
        super(age, name);

    }
}*/
